home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 4_2005-2006.ISO / data / Zips / Database_S1924098152005.psc / Subforms flex / Form1.frm next >
Text File  |  2005-08-15  |  3KB  |  98 lines

  1. VERSION 5.00
  2. Object = "{5EE7D624-A906-4612-98E5-6552BD25E927}#2.0#0"; "SITSSubForm2.ocx"
  3. Begin VB.Form Form1 
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   6060
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   7350
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   6060
  11.    ScaleWidth      =   7350
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin SITSSubForms.SITSSubForm SITSSubForm1 
  14.       Height          =   3495
  15.       Left            =   120
  16.       TabIndex        =   0
  17.       Top             =   1440
  18.       Width           =   6975
  19.       _ExtentX        =   12303
  20.       _ExtentY        =   6165
  21.       BackColorBkg    =   12632256
  22.       Caption         =   "    | Name                   |^Sex             | Phone"
  23.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  24.          Name            =   "MS Sans Serif"
  25.          Size            =   12
  26.          Charset         =   0
  27.          Weight          =   400
  28.          Underline       =   0   'False
  29.          Italic          =   0   'False
  30.          Strikethrough   =   0   'False
  31.       EndProperty
  32.       Cols            =   4
  33.       Format          =   $"Form1.frx":0000
  34.    End
  35. End
  36. Attribute VB_Name = "Form1"
  37. Attribute VB_GlobalNameSpace = False
  38. Attribute VB_Creatable = False
  39. Attribute VB_PredeclaredId = True
  40. Attribute VB_Exposed = False
  41. '---------- Read before used -----------
  42. '  1/befor you use it, declared 1 array dynamic variable as follows,
  43. ' Dim c() As SITSSubForms.coltype
  44. 'add information to this array 1 by 1
  45. ' like the following code
  46. 'This code is not for sale
  47. 'For any comment please send mail to me roathvb@yahoo.com
  48.  
  49. Private Sub Form_Load()
  50. Dim cnn As New ADODB.Connection
  51. Dim rst As New ADODB.Recordset
  52. Dim c() As SITSSubForms.coltype
  53.     'Set SITSSubForm1.Container = Picture1
  54.     SITSSubForm1.Cols = 4
  55.     cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data source=c:\db1.mdb"
  56.     'number of column in your subform
  57.     rst.ActiveConnection = cnn
  58.  
  59.  
  60.     'SITSSubForm1.PutText "fdsfs" 'use to put text into cell
  61.     'MsgBox SITSSubForm1.GetText(1, 1) 'get text from a specified cell
  62.  
  63.     'put index of listbox you want to assign and recordset you want to retrieved from
  64.     rst.Open "Select Name from student"
  65.     SITSSubForm1.AssignCombo 0, rst
  66. 'SITSSubForm1
  67.          
  68. End Sub
  69.  
  70.  
  71.  
  72.  
  73.  
  74. Private Sub SITSSubForm1_BeforeDelete(cancel As Integer, ByVal row As Integer)
  75.     'cancel = 1
  76.     If MsgBox("Are you sure? you want to delete this record?", vbYesNo) = vbNo Then
  77.         cancel = 1
  78.     End If
  79. End Sub
  80.  
  81.  
  82.  
  83. Private Sub SITSSubForm1_ButtonClick(ByVal col As Long, ByVal left As Long, ByVal top As Long)
  84.   If col = 3 Then
  85.     MonthView1.left = left
  86.     MonthView1.top = top + SITSSubForm1.top
  87.     MonthView1.Visible = True
  88.   End If
  89. End Sub
  90.  
  91. Private Sub SITSSubForm1_RecordChanged(oldrec() As String, newrec() As String, ByVal row As Integer)
  92.     MsgBox oldrec(1)
  93. End Sub
  94.  
  95. Private Sub SITSSubForm1_RowColChange()
  96. '    MonthView1.Visible = False
  97. End Sub
  98.